package com.czl.module_work.adapter

import android.view.View
import com.blankj.utilcode.util.StringUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.czl.base.util.ImageLoaderUtils
import com.czl.module_work.R
import com.czl.module_work.databinding.WorkItemImgBinding

class ImageAdapter:
    BaseQuickAdapter<String, BaseDataBindingHolder<WorkItemImgBinding>>(R.layout.work_item_img) {
    override fun convert(holder: BaseDataBindingHolder<WorkItemImgBinding>, item: String) {
        holder.dataBinding?.viewAdd?.visibility = if(StringUtils.isEmpty(item)){
            View.VISIBLE
        }else{
            View.GONE
        }
        holder.dataBinding?.ivPlus?.visibility = if(StringUtils.isEmpty(item)){
            View.VISIBLE
        }else{
            View.GONE
        }
        holder.dataBinding?.ivAvatar?.visibility = if(StringUtils.isEmpty(item)){
            View.GONE
        }else{
            View.VISIBLE
        }
//        ImageLoaderUtils.displayRound(context, holder.dataBinding?.ivAvatar, item,4)
    }
}